﻿using System.Collections.Generic;
using System.IO;
using System.Text.Encodings.Web;
using System.Threading.Tasks;
using Fluid;
using Fluid.Ast;

namespace ZYing.LiquidThemeEngine.Tags
{
    public static class HtmlTags
    {
        public static async ValueTask<Completion> Style(IReadOnlyList<Statement> statements, TextWriter writer, TextEncoder encoder, TemplateContext context)
        {
            await writer.WriteAsync("<style type=\"text/css\">");
            foreach (var item in statements) await item.WriteToAsync(writer, encoder, context);
            await writer.WriteAsync("</style>");
            return Completion.Normal;
        }
    }
}